<?php
// include "GenFunction.php";

?>
		
<?php
Class Gen_Groups
{
	var$Table;
	
	//поля
	var $id;
	var $name;
	
	var$array_grps_id;
	
		function Gen_Groups($num_grps=20)
	{
		$this->CreateTable();
		
		$this->array_grps_id=array_int_noreapet_autoGen($num_grps);
		foreach($this->array_grps_id as $int)
		{
			$this->id++;
			$this->name='Гр'.fun($int);
			$this->InsertData();
			
		}
		echo $this->db_query.'<br><br>';
		
	}
	
		function Show_row()
		{
			echo$this->id.'	';
			echo$this->name.'	';
			echo '<br>';
		}
		
			
		function CreateTable()
		{
		//echo
			$this->db_query.="CREATE TABLE `groups` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(50) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB CHARACTER SET=UTF8;
".'<br><br>';
		}
		
		
			function InsertData()
		{
			$id=$this->id;
			$name=$this->name;
			$this->db_query.="INSERT INTO `groups` (`id` ,`name`) VALUES ($id, '$name');"."<br>";
		}
		
}

// $g_gs=new Gen_Groups();
//ShowArray($g_gs->array_grps_id);


?>